<%@page session="false" %>
<%@page contentType="application/json" %>

<%@page import="com.googlecode.afdbaccess.web.common.util.HtmlEscaper"%>
<%@page import="com.googlecode.afdbaccess.web.common.util.IncludeChecker"%>

<%
  response.setDateHeader("Expires", 0);
  response.setHeader("Cache-control", "must-revalidate");
  IncludeChecker.demandIncluded(request);

  String parameter_message = request.getParameter("message");
  String parameter_longmessage = request.getParameter("longmessage");
  String parameter_jsonstringpart = request.getParameter("jsonstringpart");

  String jsonPart = "";
  
  jsonPart += ",\n\"msg\": \"" + HtmlEscaper.escapeStringForJavaScript(HtmlEscaper.makeHtml(parameter_message)) + "\"";

  if(parameter_longmessage != null && parameter_longmessage.trim().equals("") == false) {
    jsonPart += ",\n\"longmsg\": \"" + HtmlEscaper.escapeStringForJavaScript(HtmlEscaper.makeHtml(parameter_longmessage)) + "\"";
  }
  
  if(parameter_jsonstringpart != null && parameter_jsonstringpart.trim().equals("") == false) {
    jsonPart += ",\n" + parameter_jsonstringpart;
  }
%>
{
  "success": false<%= jsonPart %>
}